demoApp.factory('mySharedService', function($rootScope) {
    var sharedService = {};
    
    sharedService.message = '';
    sharedService.qty = -1;

    sharedService.prepForBroadcast = function(msg, quantity) {
        this.message = msg;
        this.qty = quantity;
        this.broadcastItem();
    };

    sharedService.broadcastItem = function() {
        $rootScope.$broadcast('handleBroadcast');
    };

    return sharedService;
});
